package com.xiaode.controller.app.task;

import com.jfinal.aop.Inject;
import com.jfinal.core.Controller;
import com.jfinal.core.Path;
import com.jfinal.ext.cors.EnableCORS;
import com.jfinal.kit.Ret;
import com.xiaode.util.apidoc.annotation.Api;
import com.xiaode.util.apidoc.annotation.ApiOper;
import com.xiaode.util.apidoc.annotation.ApiPara;
import javax.validation.constraints.Size;

@Path("/examine")
@Api("任务审核模块（活动审核不在此处，这里只是查询列表）")
@EnableCORS
public class ExamineController extends Controller {
    @Inject
    ExamineService service;

    
    @ApiOper("老师查询学生审核列表")
    public void findExamineStudentPage(
            @Size @ApiPara(value = "state", notes = "任务状态 1.待审核 2.已审核") Integer state,
            @Size @ApiPara(value = "page", notes = "当前页") Integer page,
    		@Size @ApiPara(value = "limit", notes = "每页大小") Integer limit) throws Exception {
        Integer userId = getAttr("userId");
        Integer userType = getAttr("userType");
        Ret ret = service.findExamineStudentPage(userId, userType, state, page, limit);
        renderJson(ret);
    }
    
    @ApiOper("查询学生的任务详情列表")
    public void findTaskDetailPage(
    		@Size @ApiPara(value = "state", notes = "任务状态 1.待审核 2.已审核") Integer state,
    		@Size @ApiPara(value = "accountId", notes = "学生账号id") Integer accountId,
    		@Size @ApiPara(value = "page", notes = "当前页") Integer page,
    		@Size @ApiPara(value = "limit", notes = "每页大小") Integer limit) throws Exception {
    	Integer myId = getAttr("userId");
        Integer myType = getAttr("userType");
        Ret ret = service.findTaskDetailPage(myId, myType, state, accountId, page, limit);
        renderJson(ret);
    }

    
    

}
